#ifndef _DATACOLLECTION_HPP
#define _DATACOLLECTION_HPP

#include <string>
#include <map>
#include <vector>
#include <boost/date_time/posix_time/posix_time.hpp>
using std::string;
using std::map;
using std::size_t;
using std::vector;
using std::pair;

namespace com_oocl_monitor
{
	namespace domain {
		struct Node
		{
			//    string _dateTime;
			boost::posix_time::ptime _dateTime;
			size_t _size;
			Node(const string& dateTime = "", const size_t& size = 0);
			bool operator==(const Node& right);
			bool operator==(const Node& right) const;
		};
		typedef Node ValueType;
		typedef string KeyType;
		typedef pair<KeyType, ValueType> DataPair;

		class  DataCollection
		{
		public:
			explicit DataCollection(const string& regexPattern = "");
			~DataCollection();
			bool isEmpty() const;
			void insert(const DataPair &);
			void insert(const KeyType& key, const ValueType& value);
			void erase(const KeyType& key);
			void clear();
			size_t size() const;
			string toString() const;
			ValueType& operator[](const KeyType& key);
			DataCollection *clone() const;
			const ValueType& operator[](const KeyType& key) const;
			friend DataCollection* operator-(const DataCollection&, const DataCollection&);
			friend DataCollection* operator+(const DataCollection&, const DataCollection&);
		private:
			map<KeyType, ValueType>	_dataSet;
			string _regexPattern;
		};
	}
}

#endif
